<!--
  * @description : 零售户信息列表
  * @descriptionDetail : 零售户信息列表-编辑-FJ 
  * @author : zx
  * @create : 2024-3-12 00:00:00
-->
<template>
  <view class="page">
    <!-- #ifdef H5-ONLY -->
    <!-- 零售户查询功能中，查询条件中档位查询可选多个档位需要改成单选，档位选择框点确定后弹窗不能自动消失 找祝肖  2024-4-17   start-->
    <theme-navbar :is-white="false" backText="返回" title="编辑零售户档案" :custom-back="goBack">
      <view class="nav-right-icon">
        <!-- <u-icon name="list" color="#FFF" size="38" style="margin: 0 14rpx 0 6rpx" @tap="orgShow = true"></u-icon> -->
      </view>
    </theme-navbar>
    <!-- #endif -->
    <view class="content-list">
      <view class="u-tabs-box">
      <u-tabs :list="list" class="tabscs" :is-scroll="false" :current="current" @change="change"></u-tabs>
      </view>
      <view class="u-page tab-page" >
        <view v-show="current == 0">
          <editCertificate :key="certificateKey" :licenceInfo="loadcertificate"></editCertificate>
        </view>
        <view v-show="current == 1">
          <editLayout ref="editLayout" :key="layoutKey" :layoutInfo="loadcertificate"></editLayout>
        </view>
        <view v-show="current == 2">
          <editPeopleList :key="peopleKey" :retailerUuid="retailerUuid"></editPeopleList>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import certificateService from "@/service/certificate/certificate.service.js";
import editCertificate from "./retailerItem/editCertificate.vue";
import editLayout from "./retailerItem/editLayout.vue";
import editPeopleList from "./retailerItem/editPeopleList.vue";
export default {
  components: { editCertificate, editLayout,editPeopleList },
  //   mixins: [MescrollMoreMixin, AMapMixin],
  data() {
    return {
      list: [
        {
          name: "证照"
        },
        {
          name: "布局"
        },
        {
          name: "人员"
        }
      ],
      current: 0,
      certificateKey:0,
      layoutKey:0,
      peopleKey:0,
      // gisObj: {}
    };
  },
  onLoad(options) {
    console.log(options);
    this.retailerUuid = options.retailerUuid ? options.retailerUuid : "";
    this.licNo = options.licNo ? options.licNo : "";
  },
  mounted() {},
  methods: {
    change(index) {
      this.current = index;
    },
    loadcertificate() {
      let parms = {
        retailerUuid: this.retailerUuid,
        menuCode: null
      };
      return certificateService.getRetailcerCertificate(parms);
    },
    updateBackState(param) {
      if (param.pos) {
        setTimeout(() => {
          // this.gisObj.longLat = `${param.pos.longitude},${param.pos.latitude}`;
          console.log(this.$refs.editLayout.layoutForm, 222);
          this.$refs.editLayout.layoutForm.longLat = `${param.pos.longitude},${param.pos.latitude}`;
          this.$refs.editLayout.layoutForm.longitude = param.pos.longitude;
          this.$refs.editLayout.layoutForm.latitude = param.pos.latitude;
        }, 200);
      }
      if (param.SaveRefresh) {
        this.$modal.alert("保存成功");
        this.certificateKey+=1
        // this.$refs.editPeople.myLoadData({num:1,size:20})
        // this.$refs.editPeople.$refs['mescrollItem'].refresh()
      }
      if(param.SaveLayoutRefresh){
         this.$modal.alert("保存成功");
        this.layoutKey+=1
      }
      if(param.SaveRefreshPeople){
        this.$modal.alert("保存成功");
        this.peopleKey+=1//刷新子组件
      }
    }
    
  }
};
</script>

<style lang="scss" scoped>
@import "style/certificate/common.scss";
.page {
  padding: 0;
}
.u-tabs-box{
	width: 100%;
	position: fixed;
	z-index: 999;
	/* #ifdef H5-DINGDING || H5-WECHAT */
	top: 0px;
	/* #endif */
	/* #ifdef H5-ONLY  */
	top: 45px;
	/* #endif */
}
.tab-page{
  /* #ifdef H5-DINGDING || H5-WECHAT */
	padding-top: 45px;
	/* #endif */
	/* #ifdef H5-ONLY  */
	padding-top: 45px;
	/* #endif */
}
.content-list {
  background-color: #f3f4f5;
}
.nolicence-search-lay {
  background-color: #fff;
  position: fixed;
  // #ifndef H5-DINGDING
  top: 44px;
  // #endif
  // #ifdef H5-DINGDING
  top: 44px;
  // #endif
  z-index: 999;
  width: 100%;
  overflow: hidden;
  padding: $cm-search-padding-row $cm-search-padding-column;
}
.re-list {
  margin: 20rpx;
  color: #666666;
  font-size: 15px;
  border-bottom: 1px solid #e9e9e9;
  // display: flex;
  // flex-direction: row;
  // justify-content: flex-start;
  // -webkit-flex-direction: row;
  background-color: #fff;
  border-radius: 12px;
  padding: 12px;
  // overflow: hidden;
}
.re-media {
  padding-right: 10px;
  vertical-align: middle;
}
.re-content {
  width: 100%;
  .re-manager {
    display: flex;
    justify-content: space-between;
    .re-title {
      width: calc(90%);
      font-size: 15px;
      color: #666;
      font-weight: 600;
      margin-bottom: 5px;
      width: 80%;
    }
  }
  .re-subtitle {
    padding-top: 5px;
    color: #666;
  }
  .re-icon {
    display: flex;
    padding-top: 10px;
  }
}
// 零售户查询功能中，查询条件中档位查询可选多个档位需要改成单选，档位选择框点确定后弹窗不能自动消失 找祝肖
</style>
